
<html>
<body>
<div id="container">
	<%@ include file="/WEB-INF/page/common/header.jsp" %>	
	<div id="navigator">
 		<a href="<c:url value="/common/home.o"/>"><fmt:message key="label.common.home" /></a> > 
 		<a href="<c:url value="/client/query.o"/>"><fmt:message key="label.client.model" /></a> > 
 		<fmt:message key="${ACTION}" />
 		<%@ include file="/WEB-INF/page/common/navigator.jsp" %>
    </div>
	<div id="midbody">
	     <div id="leftside">
	     	<br>
		    <shiro:hasPermission name="client:query">
	            <a href="<c:url value="/client/query.o"/>"><fmt:message key="label.client.action.listall" /></a>
	            &nbsp;&nbsp;&nbsp;&nbsp;
	        </shiro:hasPermission>
		</div>
	    <div id="rightside">	    	
		    <div id="bigbox">
		        <div class="title">
		        	<fmt:message key="${ACTION}" /> <fmt:message key="label.client.model" />
		        	<%@ include file="/WEB-INF/page/common/hidemenu.jsp" %>
		        </div>
		        <div class="content">
	            <form:form modelAttribute="clientStruct">
	            	<input type="hidden" id="ACTION" name="ACTION">
	                <form:errors path="*" element="div" cssClass="errors"/>
		    		<table id="detailTable" width="100%">
		    			<% out.print(request.getAttribute("clientDetailTable")); %>
		    		</table>
		    		<table id="detailButtons" width="100%">
	    				<% out.print(request.getAttribute("clientDetailButtons")); %>
	    			</table>
	            </form:form>
	            <c:if test="${ACTION == 'view'}">
	            	<table id="queryTable">
		    			<% out.print(request.getAttribute("eventQueryTable")); %>
		    		</table>
					<br>
					<% com.octopus.kernal.controller.AbstractSearchCommand command = (com.octopus.kernal.controller.AbstractSearchCommand)request.getAttribute("searchCommand"); %>
					<pg:pager url="view.o" items="<%= command.getTotalNumber()%>" 
						export="currentPageNumber=pageNumber" maxIndexPages="<%= command.getMaxIndexPages()%>" maxPageItems="<%= command.getMaxPageItems()%>">  
					    <pg:first>  
					        <a href="<c:out value="${pageUrl}" />&id=<c:out value="${id}" />">[<fmt:message key="label.common.first" />]</a>  
					    </pg:first>  
					    <pg:prev>  
					        <a href="<c:out value="${pageUrl}" />&id=<c:out value="${id}" />">[<fmt:message key="label.common.previous" />]</a>  
					    </pg:prev>  
					    <pg:pages>  
					        <c:choose>  
					            <c:when test="${currentPageNumber eq pageNumber}">  
					                <font color="red">[<c:out value="${pageNumber}" />]</font>  
					            </c:when>  
					            <c:otherwise>  
					                <a href="<c:out value="${pageUrl}" />&id=<c:out value="${id}" />">[<c:out value="${pageNumber}" />]</a>  
					            </c:otherwise>  
					        </c:choose>  
					    </pg:pages>  
					    <pg:next>  
					        <a href="<c:out value="${pageUrl}" />&id=<c:out value="${id}" />">[<fmt:message key="label.common.next" />]</a>  
					    </pg:next>  
					    <pg:last>  
					        <a href="<c:out value="${pageUrl}" />&id=<c:out value="${id}" />">[<fmt:message key="label.common.last" />]</a>  
					        -
					        [<fmt:message key="Total" />:<%= null==command?0:command.getTotalNumber()%>]
					    </pg:last>  
				    </pg:pager>
	            </c:if>
		        </div>
		    </div>
		</div>
	</div>
	<%@ include file="/WEB-INF/page/common/foot.jsp" %>

</div>

<script language="javascript">
function onViewEvent(id){
	window.location.href = "../event/view.o?id=" + id;
}

function onSortEvent(field,way){
	var sort = "";
	if(way.length > 0){
		sort = "&field.sort=" + field + ":" + way;
	}
	window.location.href = window.location.href.split("?")[0] + "?id=<c:out value="${id}" />&pager.offset=0" + sort;
}
</script>
	  
</body>
</html>
